# -*- coding: utf-8 -*-
# @Time     : 2021/11/26 11:37
# @Author   : Aries
# @File     : 类装饰器.py
# @Describe : 
# @Software : PyCharm

class Decorator:
    def __init__(self, func):
        self.func = func

    def __call__(self, *args, **kwargs):
        print("这里是装饰器添加的功能...")
        print(args)
        print(kwargs)
        a, b = args
        if isinstance(a, int) and isinstance(b, int):
            return self.func(*args, **kwargs)
        else:
            raise ValueError("值错误...")

@Decorator
def add(a, b):

    return a + b

if __name__ == '__main__':
    print(add(10, 20))

    #print(add(10, "abcd"))
